// ICONS -------------------------------------

svg {
  display: block;
}

.icon-svg {
  overflow: visible;
  transition: .2s $ease-out-quad;
  transition-property: fill, stroke;
}


// EXAMPLES -------------------------------------

.example-wrap {
  perspective: 1000px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.square, .circle, .triangle {
  display: flex;
  align-items: center;
  justify-content: center;
  color: primary-color(900);
  font-size: $fs-m;
  font-weight: 600;
  font-family: $font-stack-mono;
}

.square {
	@include size(5rem);
	background-color: $cyan;
}

.circle {
  @include size(5rem);
  border-radius: 50%;
	background-color: $cyan;
}

.triangle {
  --triangle-color: #{$cyan};
  --triangle-height: 5rem;  /* setting side of the triangle */
  
  position: relative;
  width: 0;
  height: 0;
  border-bottom: var(--triangle-height, 0) solid var(--triangle-color);
  border-left: calc(var(--triangle-height, 0) * 0.577) solid transparent;
  border-right: calc(var(--triangle-height, 0) * 0.577) solid transparent;
}

.item-image {
  @include size(100%);
  object-fit: cover;
}

.image-filter-mono {
  mix-blend-mode: multiply;
  filter: grayscale(100%) contrast(200%);
}

.item-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 20rem;
  margin: 0 auto;
}

.example-grid {
  --grid-columns: 4;
  --grid-item-size: 4rem;

  display: grid;
  grid-template-columns: repeat(var(--grid-columns), var(--grid-item-size));
  justify-content: center;
  margin: 0 auto;

  .square,
  .circle,
  .triangle,
  .item-block {
    @include size(var(--grid-item-size));
  }
}

.example-grid-2 {
  --grid-columns: 2;
}

.example-grid-9 {
  --grid-columns: 9;
  --grid-item-size: 2rem;
}

.item-block {
  @include size(5rem);
  border: 2px solid $cyan;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  grid-gap: .5rem;
  padding: .5rem;

  .square,
  .circle,
  .triangle {
    @include size(100%);
  }
}

.example-button {
  background-color: primary-color(800);
  color: primary-color(100);
  border-radius: $br-l;
  display: flex;
  align-items: center;
  font-weight: 650;
  letter-spacing: 0.025em;
  padding: $sp-xxs $sp-s;
  transition: 0.2s ease-in-out;
  transition-property: opacity, background-color, box-shadow, color;

  &:hover {
    background-color: primary-color(700);
  }

  &:active {
    color: primary-color(700);
    background-color: primary-color(100);
  }

  &:focus {
    box-shadow: 0 0 0 2px $cyan;
  }

  &:disabled {
    opacity: 0.5;
  }

  & + & {
    margin-left: $sp-xxs;
  }
}

.example-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: 0.3s ease-in-out;
  transition-property: box-shadow;
  
  & + & {
    margin-left: $sp-s;
  }
  
  span {
    color: primary-color(200);
    font-weight: 600;
    border-radius: $br-m;
    padding: $sp-xxxs $sp-xs;
    box-shadow: inset 0 0 0 2px primary-color(700);
    transition: 0.3s ease-in-out;
    transition-property: color, box-shadow;
  }

  &:hover,
  &:focus-within {
    span {
      box-shadow: inset 0 0 0 4px primary-color(500);
    }
  }

  input {
    &:checked + span {
      color: primary-color(800);
      box-shadow: inset 0 0 0 48px primary-color(100);

      &:hover {
        box-shadow: inset 0 0 0 48px primary-color(300);
      }
    }

    &:checked:focus + span {
      box-shadow: inset 0 0 0 48px primary-color(100), 0 0 0 2px $cyan;
    }
  }
}

.example-input-label {
  color: primary-color(200);
  margin-right: $sp-xs;
  font-weight: 500;
}

.example-input {
  background-color: primary-color(800);
  border-radius: $br-m;
  color: primary-color(100);
  font-weight: 600;
  font-size: $fs-l;
  height: 2.5rem;
  width: 12rem;
  padding: 0 $sp-xs;
  transition: 0.3s ease-in-out;
  transition-property: background-color, box-shadow;

  &:hover {
    background-color: primary-color(700);
  }

  &:focus {
    background-color: primary-color(700);
    box-shadow: 0 0 0 2px $cyan;
  }
}